export function validUsername(str) {
  const valid_map = ["admin", "editor"];
  return valid_map.indexOf(str.trim()) >= 0;
}
export function isExternal(path) {
  return /^(https?:|mailto:|tel:)/.test(path);
}
export let isphone = (rule, value, callback) => {
  if (value == "") {
    callback(new Error("请输入手机号"));
  }
  if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(value)) {
    callback(new Error("手机号码有误，请重填"));
  }
  callback();
};
